/*
 * @Author: MainStart pxclihai@126.com
 * @Date: 2024-07-30 09:39:04
 * @LastEditors: MainStart pxclihai@126.com
 * @LastEditTime: 2024-08-24 16:26:12
 * @FilePath: \undefinedd:\wdjg\project\wzjgwkfty03_mcu\babyos\bos\drivers\inc\b_drv_dcMotor.h
 * @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
 */
/**
 *!
 * \file        
 * \version     v0.0.1
 * \date        
 * \author      
 *******************************************************************************
 * @attention

 */
#ifndef __B_DRV_DCMOTOR_H__
#define __B_DRV_DCMOTOR_H__

#ifdef __cplusplus
extern "C" {
#endif

/*Includes ----------------------------------------------*/
#include "drivers/inc/b_driver.h"
/**
 * \addtogroup B_DRIVER
 * \{
 */

/**
 * \addtogroup DCMOTOR
 * \{
 */

/**
 * \defgroup DCMOTOR_Exported_TypesDefinitions
 * \{
 */
//<HALIF 1 GPIO
typedef struct
{
    bHalGPIOInstance_t INA1;
    bHalGPIOInstance_t INA2;
    bHalGPIOInstance_t INB1;
    bHalGPIOInstance_t INB2;
    bHalGPIOInstance_t pwr_en;
    //下面极限只有在输入百分比的时候计算。
    int32_t fwd_limit_position;
    int32_t rev_limit_position;
} bDCMOTOR_HalIf_t;
/**
 * \}
 */

/**
 * \}
 */

/**
 * \}
 */
// 此函数必需放入精准的定时中运行。如2ms定时器
void drv_motor_process_isr(void) ;

// 电机堵转检测，需要放入adc中断中快速check
uint8_t drv_motor_check_isr(uint32_t current);

#ifdef __cplusplus
}
#endif

#endif

/************************ Copyright (c) 2020 Bean *****END OF FILE****/
